GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
mark.george
/
Wiki
Compare Revisions
View Page
Back to Page History
Puppet.md
# Adding third-party repo 1. Get the key ID for the repo. Usually there will be a key file, or something equivalent listed in the download instructions. The key ID can be extracted using: ``` wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --show-keys --dry-run ``` 1. Add the puppet resource to a puppet manifest. The following is an example of the puppet code that will add the repo and install the package (using mongodb as the example): ``` include apt # add the official mongodb repo apt::source { 'mongodb-org' : comment => 'Official MongoDB repo.', location => 'https://repo.mongodb.org/apt/ubuntu', release => 'bionic/mongodb-org/4.0', repos => 'multiverse', key => { id => '9DA31620334BD75D9DCB49F368818C72E52529D4', server => 'keyserver.ubuntu.com', } } -> # instal mongodb package {'mongodb-org' : ensure => 'installed' } ``` This assumes that the key is registered on the Ubuntu key server. If not, the key will need to be installed locally as a GPG file in `/etc/apt/trusted.gpg.d/` — this can usually be extracted from the `deb` file. The other information can be found on the package's "how to use our repos" page.
# Adding third-party repo 1. Get the key from the third party and install on test machine. Usually there be something like the following on the package web site: ``` wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - ``` 1. List the keys: ``` apt-key list ``` 1. Find the key ID for the package in the list. 1. Add the puppet resource to a puppet manifest. The following is an example of the puppet code that will add the repo and install the package (using mongodb as the example): ``` include apt # add the official mongodb repo apt::source { 'mongodb-org' : comment => 'Official MongoDB repo.', location => 'https://repo.mongodb.org/apt/ubuntu', release => 'bionic/mongodb-org/4.0', repos => 'multiverse', key => { id => '9DA31620334BD75D9DCB49F368818C72E52529D4', server => 'keyserver.ubuntu.com', } } -> # instal mongodb package {'mongodb-org' : ensure => 'installed' } ``` The ID is the key that was found in step 3 with all spaces removed. The other information can be found on the package's "how to use our repos" page.